<?php
/**
 * 测定使用，通用上传（批量处理Excel数据）
 * User: bgl
 * Date: 2023/7/17
 * Time: 18:06
 */

namespace App\Admin\Controllers\SysManage;


use App\Admin\Extensions\Grid\Tool\Import;
use App\Models\Sys\TestUser;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Grid;

class TestExcelController extends AdminController{

    protected $title = '测试上传（临时）';

    protected function grid()
    {

        $grid = new Grid(new TestUser());

        if (Admin::user()->id == 1) {
            $grid->tools(function (Grid\Tools $tools) {
                $tools->append(new Import('sys-manage/test-excel-upload?type=plat-sku'));
            });
        }

        $grid->disableCreateButton();
        $grid->disableRowSelector();
        $grid->disableExport();

        return $grid;
    }

}
